<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title>Login</title>
</head>
<body>

<div class="nav">
    <span class="spacer">Please login...</span>
</div>
<div class="body">
    <div class="nav"><span class="spacer"></span>
        <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
        </g:if>
    </div>


    %{--
        <label>postUrl is:   ${postUrl}</label>
        this crap doesn't work cause the url gets escaped (yes the /'s get escaped WTF!)
        AND it adds another root context, really? WTF?  HOW FAIL IS THAT?
        and all hell breaks loose.
        <g:form action="${resource(file: 'j_spring_security_check')}" method="POST"  autocomplete='off'>
    --}%
    <form action='${postUrl}' method='POST' id='loginForm' class='cssform' autocomplete='off'>
        <div class="dialog">
            <table>
                <tbody>
                <tr class="prop">
                    <td valign="top" class="name">
                        <label for="j_password"><g:message code="login.username.label" default="Username"/></label>
                    </td>
                    <td valign="top" class="value">
                        <g:textField name="j_username" value="${username}"/>
                    </td>
                </tr>
                <tr class="prop">
                    <td valign="top" class="name">
                        <label for="j_password"><g:message code="login.password.label" default="Password"/></label>
                    </td>
                    <td valign="top" class="value">
                        <g:passwordField name="j_password" value="${password}"/>
                    </td>
                </tr>
                <tr class="prop">
                    <td valign="top" class="name" colspan="2">
                        <input type='checkbox' class='chk' name='${rememberMeParameter}' id='remember_me'
                            <g:if test='${hasCookie}'>checked='checked'</g:if>/>
                        <label for='remember_me'>Remember me</label>
                    </td>
                </tr>

                </tbody>
            </table>
        </div>
        <div class="buttons">
            <g:actionSubmit class="login" value="${message(code: 'default.button.login.label', default: 'Login')}"/>
        </div>
        %{--</g:form>--}%
    </form>
</div>


<script type='text/javascript'>
    <!--
    $(document).ready(function () {
        $("#username").focus();
    });
    // -->
</script>
</body>